home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Graphics⁄Sound
/
CTalk
/
CTalk.c
< prev
next >
Wrap
Text File
|
1990-08-09
|
1KB
|
52 lines
/*CTalk talking class methods definition by Dmitri Linde <dmitri@bolvan.ph.utexas.edu>*/
#include "CTalk.h"
/*Init CTalk*/
void CTalk::ITalk(void)
{
Sex theSex =Male;
FOMode theMode =Natural;
int theRate =150;
int thePitch =100;
speechFlag=TRUE;
if (SpeechOn(ExcpsFile,&theSpeech)!=0)
speechFlag=FALSE;
}
/*Method to say a string*/
/*Note s[256] mus be a pascal string*/
void CTalk::Say(char s[256])
{
if (speechFlag==TRUE)
{
Phonemes=NewHandle(0);
TextLength=(long)s[0];
Result= Reader(theSpeech,&s[1],TextLength,Phonemes);
Result= MacinTalk(theSpeech,Phonemes);
DisposHandle(Phonemes);
}
}
/*Check to see if MacinTalk is in System folder*/
/*Use this method after ITalk()*/
Boolean CTalk::Installed(void)
{
return(speechFlag);
}
/*Dispose of speech*/
void CTalk::Dispose(void)
{
if (speechFlag==TRUE)
SpeechOff(theSpeech);
delete(this);
}
/*Set talking rate in words per minute*/
void CTalk::SetRate(int r)
{
SpeechRate(theSpeech,r);
}
/*Set speach pitch*/
void CTalk::SetPitch(int p)
{
SpeechPitch(theSpeech,p,Male);
}